From: kaf24@localhost.localdomain Date: Fri, 29 Dec 2006 16:17:53 +0000 (+0000) Subject: [SOLARIS] Fix xentop build. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15422^2~122 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=cc56b92850c76f8adb4c7da642294bec619eebc6;p=xen.git [SOLARIS] Fix xentop build. Signed-off-by: Keir Fraser --- diff --git a/tools/xenstat/xentop/Makefile b/tools/xenstat/xentop/Makefile index 2248bfb3c3..5f85d732e6 100644 --- a/tools/xenstat/xentop/Makefile +++ b/tools/xenstat/xentop/Makefile @@ -26,6 +26,7 @@ sbindir=$(prefix)/sbin CFLAGS += -DGCC_PRINTF -Wall -Werror -I$(XEN_LIBXENSTAT) LDFLAGS += -L$(XEN_LIBXENSTAT) LDLIBS += -lxenstat $(CURSES_LIBS) $(SOCKET_LIBS) +CFLAGS += -DHOST_$(XEN_OS) .PHONY: all all: xentop diff --git a/tools/xenstat/xentop/xentop.c b/tools/xenstat/xentop/xentop.c index a2ea23a735..4b610c3668 100644 --- a/tools/xenstat/xentop/xentop.c +++ b/tools/xenstat/xentop/xentop.c @@ -49,6 +49,13 @@ #define KEY_ESCAPE '\x1B' +#ifdef HOST_SunOS +/* Old curses library on Solaris takes non-const strings. */ +#define curses_str_t char * +#else +#define curses_str_t const char * +#endif + /* * Function prototypes */ @@ -269,7 +276,7 @@ static void print(const char *fmt, ...) if (!batch) { if((current_row() < lines()-1)) { va_start(args, fmt); - vwprintw(stdscr, fmt, args); + vwprintw(stdscr, (curses_str_t)fmt, args); va_end(args); } } else { @@ -283,7 +290,7 @@ static void print(const char *fmt, ...) static void attr_addstr(int attr, const char *str) { attron(attr); - addstr(str); + addstr((curses_str_t)str); attroff(attr); }